package com.android.agenda;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

import com.android.R;
import com.android.entities.AgendaEntry;

public class EventDetailsActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.details);
        
        Bundle mBundle = getIntent().getExtras();
        String eventId = mBundle.getString("eventId");
        
        //Get Event Information
        ScheduleHelper sHelper = new ScheduleHelper(this);
        AgendaEntry event = sHelper.selectEvent(eventId);
        sHelper.close();
        
        //Get textviews
        TextView tvName = (TextView) findViewById(R.id.name);
        TextView tvDescription = (TextView) findViewById(R.id.description);
        TextView tvAddress = (TextView) findViewById(R.id.address);
        TextView tvTime = (TextView) findViewById(R.id.time);
        
        //Add information to the screen
        tvName.setText(event.getName());
        tvDescription.setText(event.getDescription());
        tvAddress.setText(event.getAddress());
        tvTime.setText(event.getStartTime());
    }

}
